package com.breakfast.fun.data.entity.home.product;


import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/9/6.
 */
public class ProductState {

    /**
     * total : 5
     * pageTotal : 5
     * data : [{"wday":2,"state":"1","wdate":"2016-09-05"},{"wday":3,"state":"1","wdate":"2016-09-06"},{"wday":4,"state":"2","wdate":"2016-09-07"},{"wday":5,"state":"3","wdate":"2016-09-08"},{"wday":6,"state":"3","wdate":"2016-09-09"}]
     * msg : 查询成功
     * success : true
     */

    private int total;
    private int pageTotal;
    private String msg;
    private boolean success;
    /**
     * wday : 2
     * state : 1
     * wdate : 2016-09-05
     */

    private List<WeekdayState> data;

    public static ProductState objectFromData(String str) {

        return new Gson().fromJson(str, ProductState.class);
    }

    public static List<ProductState> arrayProductStateFromData(String str) {

        Type listType = new TypeToken<ArrayList<ProductState>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getPageTotal() {
        return pageTotal;
    }

    public void setPageTotal(int pageTotal) {
        this.pageTotal = pageTotal;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public List<WeekdayState> getData() {
        return data;
    }

    public void setData(List<WeekdayState> data) {
        this.data = data;
    }

}
